// 默认配置
var __PI_COLLECT_CONF = {
    "type":"web"
    ,"app":"pi-{customer}"
    ,"uri":"//{collectUrl}"
    ,"protocol": "{protocol}"
    ,"useCid":true
    ,"ent_id": "{ent_id}"
    ,"auto": true
    ,"modConf": {
        "stay": {
            "keep" : true
        }
    }
};

extend(__PI_COLLECT_CONF, window._COLLECT_CONF || {});

// 获取待发送的缓存队列
var cokkect_incomming = null;
if (window.PI_COLLECT && window.PI_COLLECT.__isFreak) {
    cokkect_incomming = window.PI_COLLECT._getIncomming();
    window.PI_COLLECT._destroy();
}


var pageProtocol = window.location.protocol;
pageProtocol = pageProtocol.replace(":", "");
if (
    pageProtocol === "https" &&
    __PI_COLLECT_CONF.protocol !== pageProtocol
){
    __PI_COLLECT_CONF.protocol = "https";
}
__PI_COLLECT_CONF.uri = __PI_COLLECT_CONF.protocol + ":" + __PI_COLLECT_CONF.uri;

window.__PI_COLLECT_CONF = __PI_COLLECT_CONF;
